package com.dhcc.bpm;

import com.dhcc.bpm.common.constant.CommonConstant;
import com.github.tobato.fastdfs.FdfsClientConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @ClassName Application
 * @Description 启动器
 * @Author xiafayu
 * @Date 2020/2/21 0021 15:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
@EnableAsync
@EnableScheduling
// @EnableCaching
@SpringBootApplication
@MapperScan({"com.dhcc.bpm.modules.*.mapper", "com.dhcc.bpm.modules.*.*.mapper", "com.dhcc.bpm.business.*.mapper","com.dhcc.bpm.alarm.mapper","com.dhcc.bpm.common.segmentId"})
@Import(FdfsClientConfig.class)
public class Application extends SpringBootServletInitializer {
    /**
     * @Description 使用war包部署配置
     * @Author xiafayu
     * @Date 2020/2/24 20:08
     * @param application
     * @return org.springframework.boot.builder.SpringApplicationBuilder
     * @throws
     **/
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		BladeApplication.createSpringApplicationBuilder(CommonConstant.APPLICATION_NAME, Application.class);
		return application.sources(Application.class);
	}

	/**
	 * @Description 启动函数
	 * @Author xiafayu
	 * @Date 2020/2/24 20:08
	 * @param args
	 * @return void
	 * @throws`
	 **/
	public static void main(String[] args) {
		BladeApplication.run(CommonConstant.APPLICATION_NAME, Application.class, args);
	}

}